<template>
  <div class="h-slide-box">
    <swiper :options="swiperOption">
      <swiper-slide v-for="(url,i) in urls" :key="i">
        <img :src="url" alt>
      </swiper-slide>
    </swiper>
    <div class="swiper-pagination" slot="pagination"></div>
  </div>
</template>

<script>
import "swiper/dist/css/swiper.css";
import { swiper, swiperSlide } from "vue-awesome-swiper";
export default {
  data() {
    return {
      swiperOption: {
        autoplay: true,
        speed: 1000,
        // 循环滚动
        loop: true,
        //轮播图分页
        pagination: {
          el: ".swiper-pagination",
          clickable: true
        }
      },
      urls: [
        "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/article/1543042282308.APP1.jpg",
        "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/article/1543043241174.APP2.jpg",
        "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/article/1543044343480.APP3.jpg",
        "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/article/1543043052622.APP4.jpg",
        "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/article/1543044521526.APP5.jpg"
      ]
    };
  },
  components: {
    swiper,
    swiperSlide
  }
};
</script>

<style lang="scss">
.h-slide-box {
  height: 150px;
  position: relative;
  .swiper-slide {
    img {
      height: 150px;
      width: 100%;
    }
  }
  .swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    .swiper-pagination-bullet {
      margin-left: 8px;
    }
    .swiper-pagination-bullet-active {
      background: #ee4433;
    }
  }
}
</style>
